<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	
	>
<h:head>
	<title>Welcome to OTV_JSF_Spring_Hibernate_Project</title>
	<style type="text/css">
.ui-widget,.ui-widget .ui-widget {
	font-size: 12px !important;
}
.ui-growl {
right: 50%;

}
.gm-style-iw {
width: 300px; 
min-height: 150px;
}
</style>

		
		
	
</h:head>
<h:body>
	<h:form id="form">
		
		<p:layout fullPage="true">

			<p:layoutUnit position="north" size="100" header="Top" visible="false"
				resizable="true" closable="true" collapsible="true">

			</p:layoutUnit>

			<p:layoutUnit position="south" size="100" header="Bottom" visible="true"
				resizable="true" closable="true" collapsible="true">

			</p:layoutUnit>

			<p:layoutUnit position="west" size="300" header="Left" visible="false"
				resizable="true" closable="true" collapsible="true">

 			<h:outputLabel value="Deneme"></h:outputLabel>
 			<p:commandButton value="Goster" action="#{GcmBean.test}" update="table"></p:commandButton>
 			
			</p:layoutUnit>
			
			<p:layoutUnit position="center" header="Center">
						<p:growl id="messages" showDetail="true" sticky="false" globalOnly="false" />
				<p:commandButton value="Goster" action="#{GcmBean.showList}" update="table"></p:commandButton>
				<p:commandButton value="Clear all" action="#{GcmBean.clearAll}" update="table"></p:commandButton>
				
				
				<p:dataTable var="car" value="#{GcmBean.instances}" id="table">
					 
					<p:column headerText="msisdn">
						<h:outputText value="#{car.msisdn}" />
					</p:column>

					<p:column headerText="ID">
						<h:outputText value="#{car.regId}" />
					</p:column>
					
					<p:column headerText="Ulke">
						<h:outputText value="#{car.county}" />
					</p:column>
					
					<p:column headerText="Sehir">
						<h:outputText value="#{car.city}" />
					</p:column>
					
					<p:column headerText="Ilce">
						<h:outputText value="#{car.ilce}" />
					</p:column>
					
					<p:column headerText="Mahalle">
						<h:outputText value="#{car.mahalle}" />
					</p:column>
					
					<p:column headerText="Emlem">
						<h:outputText value="#{car.lat}" />
					</p:column>
					
					<p:column headerText="Boylam">
						<h:outputText value="#{car.lng}" />
					</p:column>
					
					<p:column style="width:32px;text-align: center">
			             <p:commandButton update=":form:multiCarDetail4" oncomplete="PF('singleCarDialog').show()" icon="ui-icon-search" title="View">
			                <f:setPropertyActionListener value="#{car}" target="#{GcmBean.selectedInstance}" />
			            </p:commandButton>
        </p:column>
        
			
				
				</p:dataTable>
		
			
    
    <p:dialog header="Selected Cars" widgetVar="singleCarDialog"  resizable="false" width="200">
        <p:outputPanel id="multiCarDetail4" style="text-align:center;">
            	<h:panelGrid columns="2">
            	<h:outputLabel value="Msisdn"></h:outputLabel>
            	<h:outputLabel value="#{GcmBean.selectedInstance.msisdn}"></h:outputLabel>
            	
            	<h:outputLabel value="RegID"></h:outputLabel>
            	<h:outputLabel value="#{GcmBean.selectedInstance.regId}"></h:outputLabel>
            	
            	<h:outputLabel value="Message"></h:outputLabel>
            	<h:inputTextarea value="#{GcmBean.message}" ></h:inputTextarea>
            	
            	<p:commandButton value="Gonder" action="#{GcmBean.sendMessage}" update="messages" oncomplete="PF('singleCarDialog').hide()"></p:commandButton>
            	
            	</h:panelGrid>
           
        </p:outputPanel>
    </p:dialog>
		
			</p:layoutUnit>

		</p:layout>

	</h:form>

</h:body>
</html>
